<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Edição de Projetos</title>
	<h:outputScript library="js" name="scripts.js"></h:outputScript>
</h:head>
<h:body>

	<h:form>
		<h:messages />

		<h:panelGrid columns="2">
			<f:facet name="header">Edição de Projetos</f:facet>
			<f:facet name="footer">
				<div align="center">
					<h:commandButton value="Cancelar" action="#{projetoBean.cancelar()}" immediate="true" />
					<h:commandButton value="Gravar" action="#{projetoBean.gravar()}" />
				</div>
			</f:facet>

			<h:outputLabel value="ID" for="campo-id" />
			<h:inputText value="#{projetoBean.projeto.id}" readonly="true" id="campo-id" />

			<h:outputLabel value="Nome" for="campo-nome" />
			<h:inputText value="#{projetoBean.projeto.nome}" size="40" maxlength="40" id="campo-nome" />

			<h:outputLabel value="Descrição" for="campo-descricao" />
			<h:inputTextarea value="#{projetoBean.projeto.descricao}" rows="5" cols="60" id="campo-descricao" />

			<h:outputLabel value="Início" for="campo-inicio" />
			<h:inputText value="#{projetoBean.projeto.inicio}" id="campo-inicio" size="12" onkeydown="Mascara(this, Data)"
				onkeypress="Mascara(this, Data)" onkeyup="Mascara(this, Data)">
				<f:converter converterId="converterCalendar" />
			</h:inputText>

			<h:outputLabel value="Fim" for="campo-fim" />
			<h:inputText value="#{projetoBean.projeto.fim}" size="12" id="campo-fim" onkeydown="Mascara(this,Data)"
				onkeypress="Mascara(this,Data)" onkeyup="Mascara(this,Data)">
				<f:converter converterId="converterCalendar" />
			</h:inputText>

			<h:outputLabel value="Ativo" for="campo-ativo" />
			<h:selectBooleanCheckbox value="#{projetoBean.projeto.ativo}" id="campo-ativo" />

			<h:outputLabel value="Setor" for="campo-setor" />
			<h:selectOneMenu value="#{projetoBean.projeto.setor}" converter="#{projetoBean.converterSetor}" id="campo-setor">
				<f:selectItem itemLabel="Selecione um Setor" noSelectionOption="true" />
				<f:selectItems value="#{setorBean.listarTodos()}" />
			</h:selectOneMenu>

		</h:panelGrid>


	</h:form>

</h:body>
</html>
